{extend name='admin@main'}

{block name="button"}
{if auth("meetyou/member/add")}
<button data-open='{:url("add")}' data-title="添加会员" class='layui-btn layui-btn-sm layui-btn-primary'>添加会员</button>
{/if}
{/block}

{block name="content"}
<div class="think-box-shadow">
    {include file='member/index_search'}
    <table class="layui-table margin-top-10" lay-skin="line">
        {notempty name='list'}
        <thead>
        <tr>
            <th class='text-left nowrap'>ID</th>
            <th class='text-left nowrap'>会员账号</th>
            <th class='text-left nowrap'>会员信息</th>
            <th class='text-left nowrap'>会员等级</th>

            <th class='text-left nowrap'>积分/余额</th>
            <th class='text-left nowrap'>推广员</th>
            <th class='text-left nowrap'>状态</th>
            <th class='text-left nowrap'>注册时间</th>
            <th class='text-left nowrap'>操作</th>
        </tr>
        </thead>
        {/notempty}
        <tbody>
        {foreach $list as $key=>$vo}
        <tr>
            <td class='text-left nowrap'>
                <label>{$vo.id}</label>
            </td>
            <td class='text-left'>
                {$vo.account}</td>
            <td class='text-left nowrap'>
                {notempty name='vo.avatar'}
                <img data-tips-image style="width:40px;height:40px" src="{$vo.avatar|default=''}" class="margin-right-5 text-top">
                {/notempty}
                <div class="inline-block">
                    昵称：{$vo.nickname|default='--'}<br>
                    姓名：{$vo.realname|default='--'}
                </div>
            </td>
            <td class='text-left'>
                {$vo.levelname|default='默认等级'}
            </td>
            <td class='text-left'>
                {$vo.credit1}积分
                <br/>
                {$vo.credit2}元
            </td>
            <td class='text-left'>
                {if !empty($vo.pid)}
                {$vo.pnickname|default='--'}
                <br/>
                {$vo.pphone|default='--'}
                {else}
                    --
                {/if}
            </td>

            <td class='text-left'>
                状态：
                {switch $vo.status }
                {case 1}<span class="layui-badge layui-bg-green">正常</span>{/case}
                {default /}<span class="layui-badge layui-bg-black">禁止</span>
                {/switch}
                <br/>
                推广：
                {switch $vo.is_agent }
                {case 1}<span class="layui-badge layui-bg-green">正常</span>{/case}
                {default /}<span class="layui-badge layui-bg-black">禁止</span>
                {/switch}
            </td>

            <td class='text-left'>{$vo.create_at|format_datetime|str_replace=' ','<br><span class="color-desc">时间：',###|raw}</td>

            <td class='text-left nowrap'>
                {if auth("meetyou/member/edit")}
                <a class="layui-btn layui-btn-xs layui-btn-normal" data-title="设置密码" data-modal='{:url("pass")}?id={$vo.id}'>密 码</a>
                <a class="layui-btn layui-btn-xs layui-btn-warm" data-title="充值" data-modal='{:url("recharge")}?type=credit1&id={$vo.id}'>充 值</a>
                <a data-dbclick data-title="编辑" class="layui-btn layui-btn-xs" data-open='{:url("edit")}?id={$vo.id}'>编 辑</a>
                {/if}
            </td>
        </tr>
        {/foreach}
        </tbody>
    </table>
    {empty name='list'}<span class="notdata">没有记录哦</span>{else}{$pagehtml|raw|default=''}{/empty}
</div>
{/block}
